package com.stox.charting.ui.swing.presenter;

import com.stox.charting.ui.swing.model.Axis;
import com.stox.charting.ui.swing.model.Chart;
import com.stox.charting.ui.swing.view.ChartView;

public class ChartViewPresenter {

	private ChartPresenter chartPresenter;
	private AxisPresenter axisPresenter;

	public void present(ChartView chartView){
		if(chartView != null && chartView.getChartCount() > 0){
			for(Axis axis : chartView.getAxes()){
				axisPresenter.present(axis);
			}
			
			for(int i = 0; i < chartView.getChartCount(); i++){
				Chart<?> chart = chartView.getChart(i);
				if(chart != null){
					chartPresenter.present(chart);
				}
			}
		}
	}

	public ChartPresenter getChartPresenter() {
		return chartPresenter;
	}

	public void setChartPresenter(ChartPresenter chartPresenter) {
		this.chartPresenter = chartPresenter;
	}


	public AxisPresenter getAxisPresenter() {
		return axisPresenter;
	}

	public void setAxisPresenter(AxisPresenter axisPresenter) {
		this.axisPresenter = axisPresenter;
	}
	
}
